

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Linear algebra routines &mdash; quippy 7ea04c5+ documentation</title>
  

  
  
    <link rel="shortcut icon" href="_static/favicon.ico"/>
  
  
  

  
  <script type="text/javascript" src="_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script type="text/javascript" src="_static/jquery.js"></script>
        <script type="text/javascript" src="_static/underscore.js"></script>
        <script type="text/javascript" src="_static/doctools.js"></script>
        <script type="text/javascript" src="_static/language_data.js"></script>
        <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
        <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "math|output_area", "processEscapes": true, "ignoreClass": "document", "inlineMath": [["$", "$"], ["\\(", "\\)"]]}})</script>
    
    <script type="text/javascript" src="_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Quaternions and rotation" href="quaternions.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="index.html" class="icon icon-home"> quippy
          

          
            
            <img src="_static/hybrid.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
              <div class="version">
                7ea04c5+
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
    
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to <code class="docutils literal notranslate"><span class="pre">quippy</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation of QUIP and quippy</a></li>
<li class="toctree-l1"><a class="reference internal" href="Tutorials/index.html">Tutorials</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="quippy.html">Quippy library reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="quippy.html#core-functionality">Core functionality</a></li>
<li class="toctree-l2"><a class="reference internal" href="quippy.html#structure-generation-manipulation-and-analysis">Structure generation, manipulation and analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="quippy.html#molecular-dynamics">Molecular Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="quippy.html#additional-tools-for-potentials">Additional tools for Potentials</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="quippy.html#mathematical-and-optimisation-tools">Mathematical and optimisation tools</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Linear algebra routines</a></li>
<li class="toctree-l3"><a class="reference internal" href="quaternions.html">Quaternions and rotation</a></li>
<li class="toctree-l3"><a class="reference internal" href="spline.html">Cubic spline interpolation</a></li>
<li class="toctree-l3"><a class="reference internal" href="simplex.html">Nelder and Mead minimisation algorithm</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="quippy.html#units-data-and-constants">Units, Data and Constants</a></li>
<li class="toctree-l2"><a class="reference internal" href="quippy.html#low-level-routines-and-datatypes">Low level routines and datatypes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="visualisation.html">Visualisation Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="fortran_wrapper.html">Appendix: wrapping Fortran 90 Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="teach_sparse.html">Command line options of the teach_sparse main program</a></li>
</ul>

            
          
    <p></p>
    <ul>
        <li><a href="genindex.html">Index</a></li>
        <li><a href="py-modindex.html">Module Index</a></li>
        <li><a href="search.html">Search Page</a></li>
        <li><a href="_modules/index.html">Module Source Code</a></li>
    </ul>
  
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">quippy</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
          <li><a href="quippy.html">Quippy library reference</a> &raquo;</li>
        
      <li>Linear algebra routines</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/linearalgebra.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  
<style>
/* CSS overrides for sphinx_rtd_theme */

/* 24px margin */
.nbinput.nblast,
.nboutput.nblast {
    margin-bottom: 19px;  /* padding has already 5px */
}

/* ... except between code cells! */
.nblast + .nbinput {
    margin-top: -19px;
}

.admonition > p:before {
    margin-right: 4px;  /* make room for the exclamation icon */
}

/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */
.math {
    text-align: unset;
}
</style>
<div class="section" id="module-quippy.linearalgebra">
<span id="linear-algebra-routines"></span><h1>Linear algebra routines<a class="headerlink" href="#module-quippy.linearalgebra" title="Permalink to this headline">¶</a></h1>
<p>This is a general purpose linear algebra module, extending
the Fortran intrinsics
This module defines dot products between matrices and vectors,
wrappers to textsc{lapack} for matrix diagonalisation and inversion,
as well as array searching, sorting and averaging.</p>
<p>Module contents for <a class="reference internal" href="#module-quippy.linearalgebra" title="quippy.linearalgebra: Linear algebra rountines"><code class="xref py py-mod docutils literal notranslate"><span class="pre">quippy.linearalgebra</span></code></a>:</p>
<p class="rubric">Functions</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.arrays_lt" title="quippy.linearalgebra.arrays_lt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">arrays_lt</span></code></a>(i,j,[error])</td>
<td>compare contents of 2 cells in up to N=2 arrays (int or real), return true if contents in first cell is less than 2nd, with 1st array taking precendence.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.fit_cubic" title="quippy.linearalgebra.fit_cubic"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fit_cubic</span></code></a>(x0,y0,y0p,x1,y1,y1p)</td>
<td>Fit a cubic polynomial to a function given its values (<span class="math notranslate nohighlight">\(y_0\)</span> and <span class="math notranslate nohighlight">\(y_1\)</span>) and its derivative (<span class="math notranslate nohighlight">\(y^\prime_0\)</span> and <span class="math notranslate nohighlight">\(y^\prime_1\)</span>) at two points (<span class="math notranslate nohighlight">\(x_0\)</span> and <span class="math notranslate nohighlight">\(x_1\)</span>)</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.kmeans" title="quippy.linearalgebra.kmeans"><code class="xref py py-obj docutils literal notranslate"><span class="pre">kmeans</span></code></a>(data,k,means,assign,[err,initialisation])</td>
<td>K-means clustering.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.round_prime_factors" title="quippy.linearalgebra.round_prime_factors"><code class="xref py py-obj docutils literal notranslate"><span class="pre">round_prime_factors</span></code></a>(n,[max_prime_factor,error])</td>
<td>round n to the nearest number greater or equal to n with prime factors of only 2, 3, 5, …</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.random_unit_vector" title="quippy.linearalgebra.random_unit_vector"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_unit_vector</span></code></a>()</td>
<td>Returns a random unit vector which is uniformly distributed over the unit sphere [See Knop, CACM 13 326 (1970)].</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.int_array_gt" title="quippy.linearalgebra.int_array_gt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">int_array_gt</span></code></a>(array1,array2)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.trapezoidintegral" title="quippy.linearalgebra.trapezoidintegral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trapezoidintegral</span></code></a>(x,y)</td>
<td>Calculates integral numerically using the trapezoid formula from (x,y) data pairs.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.is_in_array" title="quippy.linearalgebra.is_in_array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_in_array</span></code></a>(val)</td>
<td>Test if a given integer <code class="docutils literal notranslate"><span class="pre">val</span></code> is in an integer array <code class="docutils literal notranslate"><span class="pre">array</span></code>.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.int_array_ge" title="quippy.linearalgebra.int_array_ge"><code class="xref py py-obj docutils literal notranslate"><span class="pre">int_array_ge</span></code></a>(array1,array2)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.linear_interpolate" title="quippy.linearalgebra.linear_interpolate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">linear_interpolate</span></code></a>(x0,y0,x1,y1,x)</td>
<td>Linearly interpolate between the points <span class="math notranslate nohighlight">\((x_0,y_0)\)</span> and <span class="math notranslate nohighlight">\((x_1,y_1)\)</span>.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.cubic_interpolate" title="quippy.linearalgebra.cubic_interpolate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cubic_interpolate</span></code></a>(x0,y0,x1,y1,x)</td>
<td>Perform a cubic interpolation between the points <span class="math notranslate nohighlight">\((x_0,y_0)\)</span> and <span class="math notranslate nohighlight">\((x_1,y_1)\)</span>, using the cubic function with zero first derivative at <span class="math notranslate nohighlight">\(x_0\)</span> and <span class="math notranslate nohighlight">\(x_1\)</span>.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.oscillate" title="quippy.linearalgebra.oscillate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">oscillate</span></code></a>(m)</td>
<td>:math:` (-1)^n ` function.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.permutation_symbol" title="quippy.linearalgebra.permutation_symbol"><code class="xref py py-obj docutils literal notranslate"><span class="pre">permutation_symbol</span></code></a>()</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.factorial" title="quippy.linearalgebra.factorial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">factorial</span></code></a>(n)</td>
<td>Factorial, real result</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.pbc_aware_centre" title="quippy.linearalgebra.pbc_aware_centre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pbc_aware_centre</span></code></a>(p,lattice,g)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.ran_normal3" title="quippy.linearalgebra.ran_normal3"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ran_normal3</span></code></a>()</td>
<td>Return a three vector with normally distributed components</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.integerdigits" title="quippy.linearalgebra.integerdigits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">integerdigits</span></code></a>(base,n0,[error])</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.binom" title="quippy.linearalgebra.binom"><code class="xref py py-obj docutils literal notranslate"><span class="pre">binom</span></code></a>(n,r)</td>
<td>Binomial coefficient, real result</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.int_array_lt" title="quippy.linearalgebra.int_array_lt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">int_array_lt</span></code></a>(array1,array2)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.is_diagonal" title="quippy.linearalgebra.is_diagonal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_diagonal</span></code></a>(matrix)</td>
<td>Test if this matrix is diagonal</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.factorial2" title="quippy.linearalgebra.factorial2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">factorial2</span></code></a>(n)</td>
<td>Double factorial, real result</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.zero_sum" title="quippy.linearalgebra.zero_sum"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zero_sum</span></code></a>(array)</td>
<td>Subtract the average value from each element of a real array.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.unit_vector" title="quippy.linearalgebra.unit_vector"><code class="xref py py-obj docutils literal notranslate"><span class="pre">unit_vector</span></code></a>(theta,phi)</td>
<td>Return a unit vector in the direction given by the angles <code class="docutils literal notranslate"><span class="pre">theta</span></code> and <code class="docutils literal notranslate"><span class="pre">phi</span></code>, i.e.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.d3poly_switch" title="quippy.linearalgebra.d3poly_switch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">d3poly_switch</span></code></a>(r,cutoff_in,transition_width)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.poly_switch" title="quippy.linearalgebra.poly_switch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">poly_switch</span></code></a>(r,cutoff_in,transition_width)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.symmetric_linear_solve" title="quippy.linearalgebra.symmetric_linear_solve"><code class="xref py py-obj docutils literal notranslate"><span class="pre">symmetric_linear_solve</span></code></a>(m,a,n3)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.dcos_cutoff_function" title="quippy.linearalgebra.dcos_cutoff_function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dcos_cutoff_function</span></code></a>(r,cutoff_in)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.inverse_svd_threshold" title="quippy.linearalgebra.inverse_svd_threshold"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_svd_threshold</span></code></a>(…)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.cos_cutoff_function" title="quippy.linearalgebra.cos_cutoff_function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos_cutoff_function</span></code></a>(r,cutoff_in)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.angle" title="quippy.linearalgebra.angle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">angle</span></code></a>(a,b)</td>
<td>Return the (smallest) angle between two vectors, in radians.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.dpoly_switch" title="quippy.linearalgebra.dpoly_switch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dpoly_switch</span></code></a>(r,cutoff_in,transition_width)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.d2poly_switch" title="quippy.linearalgebra.d2poly_switch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">d2poly_switch</span></code></a>(r,cutoff_in,transition_width)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.svdfact" title="quippy.linearalgebra.svdfact"><code class="xref py py-obj docutils literal notranslate"><span class="pre">svdfact</span></code></a>(in_matrix,n2,n3,n4,n5,n6)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.factorial_int" title="quippy.linearalgebra.factorial_int"><code class="xref py py-obj docutils literal notranslate"><span class="pre">factorial_int</span></code></a>(n)</td>
<td>Factorial, integer result</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.matrix3x3_inverse" title="quippy.linearalgebra.matrix3x3_inverse"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix3x3_inverse</span></code></a>(matrix)</td>
<td>Calculate <span class="math notranslate nohighlight">\(3\times3\)</span> matrix inverse of <code class="docutils literal notranslate"><span class="pre">lattice</span></code> and store result in <code class="docutils literal notranslate"><span class="pre">g</span></code>.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.matrix3x3_det" title="quippy.linearalgebra.matrix3x3_det"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix3x3_det</span></code></a>(m)</td>
<td>Calulates determinant of <span class="math notranslate nohighlight">\(3\times3\)</span> matrix</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.fill_random_integer" title="quippy.linearalgebra.fill_random_integer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fill_random_integer</span></code></a>(n,n0,[b])</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.pseudo_inverse" title="quippy.linearalgebra.pseudo_inverse"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pseudo_inverse</span></code></a>(n2,n3,[error])</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.scalar_triple_product" title="quippy.linearalgebra.scalar_triple_product"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scalar_triple_product</span></code></a>(x,y,z)</td>
<td>Return the scalar triple product <span class="math notranslate nohighlight">\(\mathbf{x} \cdot \mathbf{y} \times \mathbf{z}\)</span> of the 3-vectors <code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code> and <code class="docutils literal notranslate"><span class="pre">z</span></code>.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.invsqrt_real_array1d" title="quippy.linearalgebra.invsqrt_real_array1d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">invsqrt_real_array1d</span></code></a>(x)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.frobenius_norm" title="quippy.linearalgebra.frobenius_norm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">frobenius_norm</span></code></a>(*args,&nbsp;**kwargs)</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.binary_search" title="quippy.linearalgebra.binary_search"><code class="xref py py-obj docutils literal notranslate"><span class="pre">binary_search</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">binary_search</span></code> containing multiple routines:</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.update_exponential_average" title="quippy.linearalgebra.update_exponential_average"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_exponential_average</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Update a measure of a recent average by decaying its current value and adding on a new sample</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.is_square" title="quippy.linearalgebra.is_square"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_square</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Test if matrix is square</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.sign" title="quippy.linearalgebra.sign"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sign</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">sign</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.dcoordination_function" title="quippy.linearalgebra.dcoordination_function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dcoordination_function</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">dcoordination_function</span></code> containing multiple routines:</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.uniq" title="quippy.linearalgebra.uniq"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uniq</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">uniq</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.find" title="quippy.linearalgebra.find"><code class="xref py py-obj docutils literal notranslate"><span class="pre">find</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">find</span></code> containing multiple routines:</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.matrix_product_vect_asdiagonal_sub" title="quippy.linearalgebra.matrix_product_vect_asdiagonal_sub"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_sub</span></code></a>(*args,&nbsp;…)</td>
<td>Matrix product with the diagonal matrix constructed from a vector in subroutine form, with no return value allocated on the stack</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.normsq" title="quippy.linearalgebra.normsq"><code class="xref py py-obj docutils literal notranslate"><span class="pre">normsq</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Euclidean norm$^2$ of a vector or a of a list of vectors.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.inverse" title="quippy.linearalgebra.inverse"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Calculate the inverse of a matrix in-place.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.trace" title="quippy.linearalgebra.trace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trace</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Return the trace of a matrix.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.randomise" title="quippy.linearalgebra.randomise"><code class="xref py py-obj docutils literal notranslate"><span class="pre">randomise</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Randomise the elements of an array.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.diag" title="quippy.linearalgebra.diag"><code class="xref py py-obj docutils literal notranslate"><span class="pre">diag</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Construct a diagonal matrix from a vector, or extract the diagonal elements of a matrix and return them as a vector.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.print_mathematica" title="quippy.linearalgebra.print_mathematica"><code class="xref py py-obj docutils literal notranslate"><span class="pre">print_mathematica</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">print_mathematica</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.matrix_product_sub" title="quippy.linearalgebra.matrix_product_sub"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix_product_sub</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Overloaded multiplication for matrix $times$ matrix in subroutine form, with no return value allocated on the stack</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.matrix_exp" title="quippy.linearalgebra.matrix_exp"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix_exp</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_exp</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.matrix_mvmt" title="quippy.linearalgebra.matrix_mvmt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix_mvmt</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Matrix product of matrix and a vector in the form: &gt; matrix * diag(vector) * transpose(matrix)</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.d2coordination_function" title="quippy.linearalgebra.d2coordination_function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">d2coordination_function</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">d2coordination_function</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.add_identity" title="quippy.linearalgebra.add_identity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_identity</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Adds the identity to a matrix</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.is_symmetric" title="quippy.linearalgebra.is_symmetric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_symmetric</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Test for matrix symmetry (with floating point equality test ‘.feq.’ as described above).</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.histogram" title="quippy.linearalgebra.histogram"><code class="xref py py-obj docutils literal notranslate"><span class="pre">histogram</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Returns a vector, contining a histogram of frequencies.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.symmetrise" title="quippy.linearalgebra.symmetrise"><code class="xref py py-obj docutils literal notranslate"><span class="pre">symmetrise</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Symmetrise a matrix: $$A to frac{A + A^T}{2}$$</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.nonsymmetric_diagonalise" title="quippy.linearalgebra.nonsymmetric_diagonalise"><code class="xref py py-obj docutils literal notranslate"><span class="pre">nonsymmetric_diagonalise</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">nonsymmetric_diagonalise</span></code> containing multiple routines:</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.insertion_sort" title="quippy.linearalgebra.insertion_sort"><code class="xref py py-obj docutils literal notranslate"><span class="pre">insertion_sort</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">insertion_sort</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.find_in_array" title="quippy.linearalgebra.find_in_array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">find_in_array</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Search an array by element or by row.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.coordination_function" title="quippy.linearalgebra.coordination_function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">coordination_function</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">coordination_function</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.make_hermitian" title="quippy.linearalgebra.make_hermitian"><code class="xref py py-obj docutils literal notranslate"><span class="pre">make_hermitian</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Test for matrix hermiticity (with floating point equals test).</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.matrix_product_vect_asdiagonal_rl_sub" title="quippy.linearalgebra.matrix_product_vect_asdiagonal_rl_sub"><code class="xref py py-obj docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_rl_sub</span></code></a>(*args,&nbsp;…)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_rl_sub</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.sort_array" title="quippy.linearalgebra.sort_array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sort_array</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">sort_array</span></code> containing multiple routines:</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.diagonalise" title="quippy.linearalgebra.diagonalise"><code class="xref py py-obj docutils literal notranslate"><span class="pre">diagonalise</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Overloaded interfaces to textsc{lapack} matrix diagonlisation functions for real and complex matrices.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.rms_diff" title="quippy.linearalgebra.rms_diff"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rms_diff</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Root-mean-square difference calculation for components of two vectors or arrays.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.trace_mult" title="quippy.linearalgebra.trace_mult"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trace_mult</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">trace_mult</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.norm" title="quippy.linearalgebra.norm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">norm</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Return the euclidean norm of a vector or of an array.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.heap_sort" title="quippy.linearalgebra.heap_sort"><code class="xref py py-obj docutils literal notranslate"><span class="pre">heap_sort</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">heap_sort</span></code> containing multiple routines:</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.d3coordination_function" title="quippy.linearalgebra.d3coordination_function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">d3coordination_function</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">d3coordination_function</span></code> containing multiple routines:</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#quippy.linearalgebra.is_orthogonal" title="quippy.linearalgebra.is_orthogonal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_orthogonal</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Test is matrix is unitary i.e.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#quippy.linearalgebra.check_size" title="quippy.linearalgebra.check_size"><code class="xref py py-obj docutils literal notranslate"><span class="pre">check_size</span></code></a>(*args,&nbsp;**kwargs)</td>
<td>Overloaded interface to assert that the size of an array is correct.</td>
</tr>
</tbody>
</table>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="82%" />
<col width="18%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Name</th>
<th class="head">Value</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="xref py py-attr docutils literal notranslate"><span class="pre">NOT_FACTORISED</span></code></td>
<td>0</td>
</tr>
<tr class="row-odd"><td><code class="xref py py-attr docutils literal notranslate"><span class="pre">QR</span></code></td>
<td>2</td>
</tr>
<tr class="row-even"><td><code class="xref py py-attr docutils literal notranslate"><span class="pre">CHOLESKY</span></code></td>
<td>1</td>
</tr>
<tr class="row-odd"><td><code class="xref py py-attr docutils literal notranslate"><span class="pre">factorial_table</span></code></td>
<td>—</td>
</tr>
</tbody>
</table>
<dl class="function">
<dt id="quippy.linearalgebra.arrays_lt">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">arrays_lt</code><span class="sig-paren">(</span><em>i</em>, <em>j</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.arrays_lt" title="Permalink to this definition">¶</a></dt>
<dd><p>compare contents of 2 cells in up to N=2 arrays (int or real), return true if
contents in first cell is less than 2nd, with 1st array taking precendence.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>i</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
<dt><strong>j</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
<dt><strong>error</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-0 array(int,’i’), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_arrays_lt</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">arrays_lt</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.fit_cubic">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">fit_cubic</code><span class="sig-paren">(</span><em>x0</em>, <em>y0</em>, <em>y0p</em>, <em>x1</em>, <em>y1</em>, <em>y1p</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.fit_cubic" title="Permalink to this definition">¶</a></dt>
<dd><p>Fit a cubic polynomial to a function given its values (<span class="math notranslate nohighlight">\(y_0\)</span> and <span class="math notranslate nohighlight">\(y_1\)</span>) and
its derivative (<span class="math notranslate nohighlight">\(y^\prime_0\)</span> and <span class="math notranslate nohighlight">\(y^\prime_1\)</span>) at two points (<span class="math notranslate nohighlight">\(x_0\)</span> and <span class="math notranslate nohighlight">\(x_1\)</span>)</p>
<div class="math notranslate nohighlight">
\[y = ax^3 + bx^2 + cx + d\]</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>x0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd><p class="first last"><span class="math notranslate nohighlight">\(x_0\)</span>, <span class="math notranslate nohighlight">\(y_0\)</span>, <span class="math notranslate nohighlight">\(y^\prime_0\)</span></p>
</dd>
<dt><strong>y0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd><p class="first last"><span class="math notranslate nohighlight">\(x_0\)</span>, <span class="math notranslate nohighlight">\(y_0\)</span>, <span class="math notranslate nohighlight">\(y^\prime_0\)</span></p>
</dd>
<dt><strong>y0p</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd><p class="first last"><span class="math notranslate nohighlight">\(x_0\)</span>, <span class="math notranslate nohighlight">\(y_0\)</span>, <span class="math notranslate nohighlight">\(y^\prime_0\)</span></p>
</dd>
<dt><strong>x1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd><p class="first last"><span class="math notranslate nohighlight">\(x_1\)</span>, <span class="math notranslate nohighlight">\(y_1\)</span>, <span class="math notranslate nohighlight">\(y^\prime_1\)</span></p>
</dd>
<dt><strong>y1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd><p class="first last"><span class="math notranslate nohighlight">\(x_1\)</span>, <span class="math notranslate nohighlight">\(y_1\)</span>, <span class="math notranslate nohighlight">\(y^\prime_1\)</span></p>
</dd>
<dt><strong>y1p</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd><p class="first last"><span class="math notranslate nohighlight">\(x_1\)</span>, <span class="math notranslate nohighlight">\(y_1\)</span>, <span class="math notranslate nohighlight">\(y^\prime_1\)</span></p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>coeffs</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (4)</span></dt>
<dd><p class="first last"><code class="docutils literal notranslate"><span class="pre">(/a,b,c,d/)</span></code></p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">fit_cubic</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.kmeans">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">kmeans</code><span class="sig-paren">(</span><em>data</em>, <em>k</em>, <em>means</em>, <em>assign</em><span class="optional">[</span>, <em>err</em>, <em>initialisation</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.kmeans" title="Permalink to this definition">¶</a></dt>
<dd><p>K-means clustering. Algorithm is as described in Numerical Recipes
(Third Edition, Section 16.1.2, pp. 848-849).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>data</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
<dt><strong>k</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
<dt><strong>means</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-2 array(‘d’) with bounds (qp_n2,qp_n3)</span></dt>
<dd></dd>
<dt><strong>assign</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-1 array(‘i’) with bounds (qp_n4)</span></dt>
<dd></dd>
<dt><strong>err</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-0 array(float,’d’), optional</span></dt>
<dd></dd>
<dt><strong>initialisation</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input string(len=-1), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">kmeans</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.round_prime_factors">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">round_prime_factors</code><span class="sig-paren">(</span><em>n</em><span class="optional">[</span>, <em>max_prime_factor</em>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.round_prime_factors" title="Permalink to this definition">¶</a></dt>
<dd><p>round n to the nearest number greater or equal to n
with prime factors of only 2, 3, 5, … max_prime_factor</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>n</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-0 array(int,’i’)</span></dt>
<dd><p class="first last">The number to be rounded</p>
</dd>
<dt><strong>max_prime_factor</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int, optional</span></dt>
<dd></dd>
<dt><strong>error</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-0 array(int,’i’), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">round_prime_factors</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.random_unit_vector">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">random_unit_vector</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.random_unit_vector" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a random unit vector which is
uniformly distributed over the unit sphere
[See Knop, CACM 13 326 (1970)].</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_v</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">random_unit_vector</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.int_array_gt">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">int_array_gt</code><span class="sig-paren">(</span><em>array1</em>, <em>array2</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.int_array_gt" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>array1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (qp_n0)</span></dt>
<dd></dd>
<dt><strong>array2</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (size(qp_array1))</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_gt</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">int_array_gt</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.trapezoidintegral">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">trapezoidintegral</code><span class="sig-paren">(</span><em>x</em>, <em>y</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.trapezoidintegral" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates integral numerically using the trapezoid formula from (x,y) data
pairs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>x</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (qp_n0)</span></dt>
<dd></dd>
<dt><strong>y</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (qp_n1)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_trapezoidintegral</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">trapezoidintegral</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.is_in_array">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_in_array</code><span class="sig-paren">(</span><em>val</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.is_in_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if a given integer <code class="docutils literal notranslate"><span class="pre">val</span></code> is in an integer array <code class="docutils literal notranslate"><span class="pre">array</span></code>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>val</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_is_in_array</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">is_in_array</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.int_array_ge">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">int_array_ge</code><span class="sig-paren">(</span><em>array1</em>, <em>array2</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.int_array_ge" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>array1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (qp_n0)</span></dt>
<dd></dd>
<dt><strong>array2</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (size(qp_array1))</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_ge</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">int_array_ge</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.linear_interpolate">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">linear_interpolate</code><span class="sig-paren">(</span><em>x0</em>, <em>y0</em>, <em>x1</em>, <em>y1</em>, <em>x</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.linear_interpolate" title="Permalink to this definition">¶</a></dt>
<dd><p>Linearly interpolate between the points <span class="math notranslate nohighlight">\((x_0,y_0)\)</span> and <span class="math notranslate nohighlight">\((x_1,y_1)\)</span>.
Returns the interpolated <span class="math notranslate nohighlight">\(y\)</span> at position <span class="math notranslate nohighlight">\(x\)</span>, where <span class="math notranslate nohighlight">\(x_0 \le x \le x_1\)</span>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>x0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>y0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>x1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>y1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>x</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_y</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">linear_interpolate</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.cubic_interpolate">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">cubic_interpolate</code><span class="sig-paren">(</span><em>x0</em>, <em>y0</em>, <em>x1</em>, <em>y1</em>, <em>x</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.cubic_interpolate" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform a cubic interpolation between the points <span class="math notranslate nohighlight">\((x_0,y_0)\)</span> and <span class="math notranslate nohighlight">\((x_1,y_1)\)</span>,
using the cubic function with zero first derivative at <span class="math notranslate nohighlight">\(x_0\)</span> and <span class="math notranslate nohighlight">\(x_1\)</span>.
Returns the interpolated <span class="math notranslate nohighlight">\(y\)</span> at position <span class="math notranslate nohighlight">\(x\)</span>, where <span class="math notranslate nohighlight">\(x_0 \le x \le x_1\)</span>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>x0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>y0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>x1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>y1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>x</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_y</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">cubic_interpolate</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.oscillate">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">oscillate</code><span class="sig-paren">(</span><em>m</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.oscillate" title="Permalink to this definition">¶</a></dt>
<dd><p>:math:` (-1)^n ` function.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>m</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_oscillate</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">oscillate</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.permutation_symbol">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">permutation_symbol</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.permutation_symbol" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_eps</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-3 array(‘d’) with bounds (3,3,3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">permutation_symbol</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.factorial">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">factorial</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.factorial" title="Permalink to this definition">¶</a></dt>
<dd><p>Factorial, real result</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>n</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_res</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">factorial</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.pbc_aware_centre">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">pbc_aware_centre</code><span class="sig-paren">(</span><em>p</em>, <em>lattice</em>, <em>g</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.pbc_aware_centre" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>p</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
<dt><strong>lattice</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (3,3)</span></dt>
<dd></dd>
<dt><strong>g</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (3,3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_c</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">pbc_aware_centre</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.ran_normal3">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">ran_normal3</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.ran_normal3" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a three vector with normally distributed components</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_ran_normal3</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">ran_normal3</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.integerdigits">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">integerdigits</code><span class="sig-paren">(</span><em>base</em>, <em>n0</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.integerdigits" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>base</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
<dt><strong>n0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_iDigits,0)</p>
</dd>
<dt><strong>error</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-0 array(int,’i’), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>idigits</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘i’) with bounds (qp_n0)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">integerdigits</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.binom">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">binom</code><span class="sig-paren">(</span><em>n</em>, <em>r</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.binom" title="Permalink to this definition">¶</a></dt>
<dd><p>Binomial coefficient, real result</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>n</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_res</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">binom</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.int_array_lt">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">int_array_lt</code><span class="sig-paren">(</span><em>array1</em>, <em>array2</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.int_array_lt" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>array1</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (qp_n0)</span></dt>
<dd></dd>
<dt><strong>array2</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (size(qp_array1))</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_lt</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">int_array_lt</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.is_diagonal">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_diagonal</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.is_diagonal" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if this matrix is diagonal</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>matrix</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_is_diagonal</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">is_diagonal</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.factorial2">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">factorial2</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.factorial2" title="Permalink to this definition">¶</a></dt>
<dd><p>Double factorial, real result</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>n</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_res</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">factorial2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.zero_sum">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">zero_sum</code><span class="sig-paren">(</span><em>array</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.zero_sum" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtract the average value from each element of a real array.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>array</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">zero_sum</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.unit_vector">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">unit_vector</code><span class="sig-paren">(</span><em>theta</em>, <em>phi</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.unit_vector" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a unit vector in the direction given by the angles <code class="docutils literal notranslate"><span class="pre">theta</span></code> and <code class="docutils literal notranslate"><span class="pre">phi</span></code>, i.e.
convert the spherical polar coordinates point <span class="math notranslate nohighlight">\((1,\theta,\phi)\)</span> to cartesians.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>theta</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>phi</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_unit_vector</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">unit_vector</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.d3poly_switch">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">d3poly_switch</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.d3poly_switch" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>cutoff_in</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>transition_width</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_d3poly_switch</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">d3poly_switch</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.poly_switch">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">poly_switch</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.poly_switch" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>cutoff_in</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>transition_width</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_poly_switch</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">poly_switch</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.symmetric_linear_solve">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">symmetric_linear_solve</code><span class="sig-paren">(</span><em>m</em>, <em>a</em>, <em>n3</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.symmetric_linear_solve" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>m</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
<dt><strong>a</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (qp_n2)</span></dt>
<dd></dd>
<dt><strong>n3</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_M_inv_a,0)</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>m_inv_a</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (qp_n3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">symmetric_linear_solve</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.dcos_cutoff_function">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">dcos_cutoff_function</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.dcos_cutoff_function" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>cutoff_in</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_dcos_cutoff_function</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">dcos_cutoff_function</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.inverse_svd_threshold">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">inverse_svd_threshold</code><span class="sig-paren">(</span><em>in_matrix</em><span class="optional">[</span>, <em>thresh</em>, <em>result_inv</em>, <em>u_out</em>, <em>vt_out</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.inverse_svd_threshold" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>in_matrix</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
<dt><strong>thresh</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float, optional</span></dt>
<dd></dd>
<dt><strong>result_inv</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-2 array(‘d’) with bounds (qp_n2,qp_n3), optional</span></dt>
<dd></dd>
<dt><strong>u_out</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-2 array(‘d’) with bounds (qp_n4,qp_n5), optional</span></dt>
<dd></dd>
<dt><strong>vt_out</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-2 array(‘d’) with bounds (qp_n6,qp_n7), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">inverse_svd_threshold</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.cos_cutoff_function">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">cos_cutoff_function</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.cos_cutoff_function" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>cutoff_in</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_cos_cutoff_function</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">cos_cutoff_function</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.angle">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">angle</code><span class="sig-paren">(</span><em>a</em>, <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.angle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the (smallest) angle between two vectors, in radians.
This is calculated as</p>
<div class="math notranslate nohighlight">
\[\arccos\left(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}| |\mathbf{b}|}\right)\]</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>a</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (qp_n0)</span></dt>
<dd></dd>
<dt><strong>b</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (qp_n1)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_angle</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">angle</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.dpoly_switch">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">dpoly_switch</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.dpoly_switch" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>cutoff_in</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>transition_width</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_dpoly_switch</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">dpoly_switch</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.d2poly_switch">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">d2poly_switch</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.d2poly_switch" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>cutoff_in</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
<dt><strong>transition_width</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_d2poly_switch</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">d2poly_switch</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.svdfact">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">svdfact</code><span class="sig-paren">(</span><em>in_matrix</em>, <em>n2</em>, <em>n3</em>, <em>n4</em>, <em>n5</em>, <em>n6</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.svdfact" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>in_matrix</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</span></dt>
<dd></dd>
<dt><strong>u_out</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-2 array(‘d’) with bounds (qp_n2,qp_n3)</span></dt>
<dd></dd>
<dt><strong>n2</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_u_out,0)</p>
</dd>
<dt><strong>n3</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_u_out,1)</p>
</dd>
<dt><strong>s_out</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (qp_n4)</span></dt>
<dd></dd>
<dt><strong>n4</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_s_out,0)</p>
</dd>
<dt><strong>vt_out</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-2 array(‘d’) with bounds (qp_n5,qp_n6)</span></dt>
<dd></dd>
<dt><strong>n5</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_vt_out,0)</p>
</dd>
<dt><strong>n6</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_vt_out,1)</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">svdfact</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.factorial_int">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">factorial_int</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.factorial_int" title="Permalink to this definition">¶</a></dt>
<dd><p>Factorial, integer result</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>n</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_res</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">factorial_int</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix3x3_inverse">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix3x3_inverse</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix3x3_inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate <span class="math notranslate nohighlight">\(3\times3\)</span> matrix inverse of <code class="docutils literal notranslate"><span class="pre">lattice</span></code> and store result in <code class="docutils literal notranslate"><span class="pre">g</span></code>.
Avoids overhead of calling textsc{lapack} for simple case of <span class="math notranslate nohighlight">\(3\times3\)</span> matrix.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>matrix</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (3,3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>g</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-2 array(‘d’) with bounds (3,3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix3x3_inverse</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix3x3_det">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix3x3_det</code><span class="sig-paren">(</span><em>m</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix3x3_det" title="Permalink to this definition">¶</a></dt>
<dd><p>Calulates determinant of <span class="math notranslate nohighlight">\(3\times3\)</span> matrix</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>m</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-2 array(‘d’) with bounds (3,3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_det</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix3x3_det</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.fill_random_integer">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">fill_random_integer</code><span class="sig-paren">(</span><em>n</em>, <em>n0</em><span class="optional">[</span>, <em>b</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.fill_random_integer" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>n0</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_r,0)</p>
</dd>
<dt><strong>n</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd></dd>
<dt><strong>b</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘i’) with bounds (qp_n1), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>r</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘i’) with bounds (qp_n0)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">fill_random_integer</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.pseudo_inverse">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">pseudo_inverse</code><span class="sig-paren">(</span><em>n2</em>, <em>n3</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.pseudo_inverse" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>n2</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_inverse,0)</p>
</dd>
<dt><strong>n3</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input int</span></dt>
<dd><p class="first last">shape(qp_inverse,1)</p>
</dd>
<dt><strong>error</strong> <span class="classifier-delimiter">:</span> <span class="classifier">in/output rank-0 array(int,’i’), optional</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>inverse</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-2 array(‘d’) with bounds (qp_n2,qp_n3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">pseudo_inverse</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.scalar_triple_product">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">scalar_triple_product</code><span class="sig-paren">(</span><em>x</em>, <em>y</em>, <em>z</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.scalar_triple_product" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the scalar triple product <span class="math notranslate nohighlight">\(\mathbf{x} \cdot \mathbf{y} \times \mathbf{z}\)</span>
of the 3-vectors <code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code> and <code class="docutils literal notranslate"><span class="pre">z</span></code>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>x</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
<dt><strong>y</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
<dt><strong>z</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (3)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_scalar_triple_product</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">scalar_triple_product</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.invsqrt_real_array1d">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">invsqrt_real_array1d</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.invsqrt_real_array1d" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
<dt><strong>x</strong> <span class="classifier-delimiter">:</span> <span class="classifier">input rank-1 array(‘d’) with bounds (qp_n0)</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_invsqrt_real_array1d</strong> <span class="classifier-delimiter">:</span> <span class="classifier">rank-1 array(‘d’) with bounds (size(qp_x))</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">invsqrt_real_array1d</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.frobenius_norm">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">frobenius_norm</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.frobenius_norm" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ret_norm</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">frobenius_norm</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.binary_search">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">binary_search</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.binary_search" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">binary_search</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">binary_search</code><span class="sig-paren">(</span><em>array</em>, <em>value</em><span class="optional">[</span>, <em>first</em>, <em>low</em>, <em>high</em>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Do binary search and return <code class="docutils literal notranslate"><span class="pre">index</span></code> of element containing <code class="docutils literal notranslate"><span class="pre">value</span></code>, or zero if not found.
<code class="docutils literal notranslate"><span class="pre">array</span></code> must be sorted into ascending order beforehand.
If the array subscripts don``t start at 1, then pass the actual index of the first element as <code class="docutils literal notranslate"><span class="pre">first',</span>
<span class="pre">then,</span> <span class="pre">if</span> <span class="pre">the</span> <span class="pre">element</span> <span class="pre">isn``t</span> <span class="pre">found,</span> <span class="pre">the</span> <span class="pre">value</span> <span class="pre">returned</span> <span class="pre">is</span> <span class="pre">``first'</span> <span class="pre">minus</span> <span class="pre">1.</span>
<span class="pre">To</span> <span class="pre">restrict</span> <span class="pre">the</span> <span class="pre">search</span> <span class="pre">to</span> <span class="pre">a</span> <span class="pre">subsection</span> <span class="pre">of</span> <span class="pre">the</span> <span class="pre">array</span> <span class="pre">supply</span> <span class="pre">``low</span></code> and/or <code class="docutils literal notranslate"><span class="pre">high</span></code>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>array</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>value</strong> (<em>input int</em>) – </li>
<li><strong>first</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>low</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>high</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_index</strong> –  int</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">binary_search_i</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">binary_search</code><span class="sig-paren">(</span><em>array</em>, <em>value</em><span class="optional">[</span>, <em>first</em>, <em>low</em>, <em>high</em>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Do binary search and return <code class="docutils literal notranslate"><span class="pre">index</span></code> of element being smaller or equal
to <code class="docutils literal notranslate"><span class="pre">value</span></code>. <code class="docutils literal notranslate"><span class="pre">array</span></code> must be sorted into ascending order beforehand.
If the array subscripts don’t start at 1, then pass the actual index of
the first element as <code class="docutils literal notranslate"><span class="pre">first</span></code></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>array</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>value</strong> (<em>input float</em>) – </li>
<li><strong>first</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>low</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>high</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_index</strong> –  int</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">binary_search_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.update_exponential_average">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">update_exponential_average</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.update_exponential_average" title="Permalink to this definition">¶</a></dt>
<dd><p>Update a measure of a recent average by decaying its current value and adding on a new sample</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">update_exponential_average</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">update_exponential_average</code><span class="sig-paren">(</span><em>average</em>, <em>decay</em>, <em>x</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>average</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><em>float</em></a><em>,</em><em>'d'</em><em>)</em>) – </li>
<li><strong>decay</strong> (<em>input float</em>) – </li>
<li><strong>x</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">update_exponential_average_s</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">update_exponential_average</code><span class="sig-paren">(</span><em>average</em>, <em>decay</em>, <em>x</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>average</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>decay</strong> (<em>input float</em>) – </li>
<li><strong>x</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>size</em><em>(</em><em>qp_average</em><em>)</em><em>)</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">update_exponential_average_v</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">update_exponential_average</code><span class="sig-paren">(</span><em>average</em>, <em>decay</em>, <em>x</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>average</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>decay</strong> (<em>input float</em>) – </li>
<li><strong>x</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">update_exponential_average_d2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.is_square">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_square</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.is_square" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix is square</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">is_square</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_square</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_sq</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_square</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_square</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_sq</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">int_matrix_square</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_square</code><span class="sig-paren">(</span><em>matrix_z</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix_z</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_sq</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_square</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_square</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_sq</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">logical_matrix_square</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.sign">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">sign</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>n</strong> (<em>input int</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_int_sign</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">int_sign</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>n</strong> (<em>input float</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_real_sign</strong> –  float</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">real_sign</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.dcoordination_function">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">dcoordination_function</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.dcoordination_function" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">dcoordination_function</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">dcoordination_function</code><span class="sig-paren">(</span><em>r</em>, <em>lower_cutoff_in</em>, <em>lower_transition_width</em>, <em>upper_cutoff_in</em>, <em>upper_transition_width</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>r</strong> (<em>input float</em>) – </li>
<li><strong>lower_cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>lower_transition_width</strong> (<em>input float</em>) – </li>
<li><strong>upper_cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>upper_transition_width</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_dcoordination_function_lower_upper</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">dcoordination_function_lower_upper</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">dcoordination_function</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>r</strong> (<em>input float</em>) – </li>
<li><strong>cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>transition_width</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_dcoordination_function_upper</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">dcoordination_function_upper</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.uniq">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">uniq</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.uniq" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">uniq</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">uniq</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>unique</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>unique</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">uniq_real_dim2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.find">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">find</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.find" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">find</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">find</code><span class="sig-paren">(</span><em>mask</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><p>Collect the indices corresponding to .true. elements of a mask
can be used to index other arrays, e.g. array(find(mask))</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>mask</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_ret_find_indices,0)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_find_indices</strong> –  rank-1 array(‘i’) with bounds (qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">find_indices</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix_product_vect_asdiagonal_sub">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix_product_vect_asdiagonal_sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Matrix product with the diagonal matrix constructed from a vector in subroutine form,
with no return value allocated on the stack</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_sub</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>vectl</em>, <em>matrix</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>vectl</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vect_asdiagonal_product_matrix_sub_ddd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_sub_zdz</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>vectl</em>, <em>matrix</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>vectl</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vect_asdiagonal_product_matrix_sub_zzd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>vectl</em>, <em>matrix</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>vectl</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vect_asdiagonal_product_matrix_sub_zdz</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_sub_zzz</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_sub_zzd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_sub_ddd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_sub</code><span class="sig-paren">(</span><em>vectl</em>, <em>matrix</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>vectl</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vect_asdiagonal_product_matrix_sub_zzz</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.normsq">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">normsq</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.normsq" title="Permalink to this definition">¶</a></dt>
<dd><p>Euclidean norm$^2$ of a vector or a of a list of vectors. Result is equal
to ‘x .dot. x’ for a single vector ‘x’.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">normsq</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">normsq</code><span class="sig-paren">(</span><em>vector</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vector</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_normsq</strong> –  float</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_normsq</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">normsq</code><span class="sig-paren">(</span><em>this</em>, <em>dir</em>, <em>n2</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>dir</strong> (<em>input int</em>) – </li>
<li><strong>n2</strong> (<em>input int</em>) – shape(qp_ret_array_normsq,0)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_array_normsq</strong> –  rank-1 array(‘d’) with bounds (qp_n2)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">array_normsq</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.inverse">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">inverse</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the inverse of a matrix in-place. Uses textsc{lapack} to compute the inverse.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">inverse</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">inverse</code><span class="sig-paren">(</span><em>matrix</em><span class="optional">[</span>, <em>inverse</em>, <em>positive_in</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>inverse</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>positive_in</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_inverse</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">inverse</code><span class="sig-paren">(</span><em>matrix</em><span class="optional">[</span>, <em>inverse</em>, <em>positive_in</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>inverse</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>positive_in</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_inverse</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.trace">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">trace</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.trace" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the trace of a matrix.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">trace</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">trace</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_tr</strong> –  float</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_trace</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.randomise">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">randomise</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.randomise" title="Permalink to this definition">¶</a></dt>
<dd><p>Randomise the elements of an array. Uniformly distributed random quantities in the range
$(-frac{a}{2},frac{a}{2})$ are added to each element of the vector or matrix.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">randomise</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">randomise</code><span class="sig-paren">(</span><em>m</em>, <em>a</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>m</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>a</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_randomise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">randomise</code><span class="sig-paren">(</span><em>m</em>, <em>a</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>m</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>a</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_randomise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">randomise</code><span class="sig-paren">(</span><em>m</em>, <em>a</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>m</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>a</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_randomise_vweight</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">randomise</code><span class="sig-paren">(</span><em>v</em>, <em>a</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>v</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>a</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_randomise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">randomise</code><span class="sig-paren">(</span><em>v</em>, <em>a</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>v</strong> (<em>in/output rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>a</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_z_randomise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.diag">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diag</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.diag" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a diagonal matrix from a vector, or extract the diagonal elements
of a matrix and return them as a vector.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">diag</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diag</code><span class="sig-paren">(</span><em>matrix</em>, <em>n2</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n2</strong> (<em>input int</em>) – shape(qp_ret_vect,0)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_vect</strong> –  rank-1 array(‘d’) with bounds (qp_n2)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_diagonal_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diag</code><span class="sig-paren">(</span><em>matrix</em>, <em>n2</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n2</strong> (<em>input int</em>) – shape(qp_ret_vect,0)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_vect</strong> –  rank-1 array(‘D’) with bounds (qp_n2)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_diagonal_c</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diag</code><span class="sig-paren">(</span><em>vect</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_matrix</strong> –  rank-2 array(‘D’) with bounds (size(qp_vect),size(qp_vect))</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_as_diag_matrix_c</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diag</code><span class="sig-paren">(</span><em>vect</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_matrix</strong> –  rank-2 array(‘d’) with bounds (size(qp_vect),size(qp_vect))</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_as_diag_matrix_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.print_mathematica">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">print_mathematica</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.print_mathematica" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">print_mathematica</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">print_mathematica</code><span class="sig-paren">(</span><em>label</em>, <em>this</em><span class="optional">[</span>, <em>verbosity</em>, <em>file</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>label</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>verbosity</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>file</strong> (<a class="reference internal" href="system.html#quippy.system.InOutput" title="quippy.system.InOutput"><code class="xref py py-class docutils literal notranslate"><span class="pre">InOutput</span></code></a> object, optional) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_print_mathematica</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">print_mathematica</code><span class="sig-paren">(</span><em>label</em>, <em>this</em><span class="optional">[</span>, <em>verbosity</em>, <em>file</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>label</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>verbosity</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>file</strong> (<a class="reference internal" href="system.html#quippy.system.InOutput" title="quippy.system.InOutput"><code class="xref py py-class docutils literal notranslate"><span class="pre">InOutput</span></code></a> object, optional) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_print_mathematica</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix_product_sub">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_sub</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix_product_sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded multiplication for matrix $times$ matrix in subroutine form,
with no return value allocated on the stack</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_product_sub</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_sub</code><span class="sig-paren">(</span><em>matrix1</em>, <em>matrix2</em>, <em>n0</em>, <em>n1</em><span class="optional">[</span>, <em>m1_transpose</em>, <em>m2_transpose</em>, <em>lhs_factor</em>, <em>rhs_factor</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix1</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>matrix2</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>,</em><em>qp_n5</em><em>)</em>) – </li>
<li><strong>m1_transpose</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>m2_transpose</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>lhs_factor</strong> (<em>input float</em><em>, </em><em>optional</em>) – </li>
<li><strong>rhs_factor</strong> (<em>input float</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_sub_ddd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vector</em>, <em>n0</em><span class="optional">[</span>, <em>m_transpose</em>, <em>lhs_factor</em>, <em>rhs_factor</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n1</em><em>,</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>vector</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>m_transpose</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>lhs_factor</strong> (<em>input float</em><em>, </em><em>optional</em>) – </li>
<li><strong>rhs_factor</strong> (<em>input float</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-1 array(‘d’) with bounds (qp_n0)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_vector_product_sub_ddd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix_exp">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_exp</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix_exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_exp</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_exp</code><span class="sig-paren">(</span><em>a</em>, <em>n2</em>, <em>n3</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>a</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n2</strong> (<em>input int</em>) – shape(qp_ret_matrix_exp_d,0)</li>
<li><strong>n3</strong> (<em>input int</em>) – shape(qp_ret_matrix_exp_d,1)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_matrix_exp_d</strong> –  rank-2 array(‘d’) with bounds (qp_n2,qp_n3)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_exp_d</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix_mvmt">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_mvmt</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix_mvmt" title="Permalink to this definition">¶</a></dt>
<dd><p>Matrix product of matrix and a vector in the form:
&gt; matrix * diag(vector) * transpose(matrix)</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_mvmt</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_mvmt</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n3</em>, <em>n4</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>n3</strong> (<em>input int</em>) – shape(qp_ret_prodmatrix,0)</li>
<li><strong>n4</strong> (<em>input int</em>) – shape(qp_ret_prodmatrix,1)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_prodmatrix</strong> –  rank-2 array(‘d’) with bounds (qp_n3,qp_n4)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_cfct</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.d2coordination_function">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">d2coordination_function</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.d2coordination_function" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">d2coordination_function</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">d2coordination_function</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>r</strong> (<em>input float</em>) – </li>
<li><strong>cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>transition_width</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_d2coordination_function_upper</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">d2coordination_function_upper</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.add_identity">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">add_identity</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.add_identity" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds the identity to a matrix</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">add_identity</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">add_identity</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_add_identity_c</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">add_identity</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_add_identity_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.is_symmetric">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_symmetric</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.is_symmetric" title="Permalink to this definition">¶</a></dt>
<dd><p>Test for matrix symmetry (with floating point equality test ‘.feq.’ as described above).</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">is_symmetric</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_symmetric</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_symm</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_is_symmetric</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_symmetric</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_symm</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">int_matrix_is_symmetric</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_symmetric</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_symm</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_is_symmetric</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.histogram">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">histogram</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.histogram" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a vector, contining a histogram of frequencies.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">histogram</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">histogram</code><span class="sig-paren">(</span><em>vector</em>, <em>min_x</em>, <em>max_x</em>, <em>nbin</em>, <em>n1</em><span class="optional">[</span>, <em>weight_vector</em>, <em>drop_outside</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>vector</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>min_x</strong> (<em>input float</em>) – </li>
<li><strong>max_x</strong> (<em>input float</em>) – </li>
<li><strong>nbin</strong> (<em>input int</em>) – </li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_ret_vector_histogram,0)</li>
<li><strong>weight_vector</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>drop_outside</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_vector_histogram</strong> –  rank-1 array(‘d’) with bounds (qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_histogram</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.symmetrise">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">symmetrise</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.symmetrise" title="Permalink to this definition">¶</a></dt>
<dd><p>Symmetrise a matrix: $$A to frac{A + A^T}{2}$$</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">symmetrise</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">symmetrise</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_symmetrise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.nonsymmetric_diagonalise">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">nonsymmetric_diagonalise</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.nonsymmetric_diagonalise" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">nonsymmetric_diagonalise</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">nonsymmetric_diagonalise</code><span class="sig-paren">(</span><em>this</em>, <em>n2</em><span class="optional">[</span>, <em>l_evects</em>, <em>r_evects</em>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n2</strong> (<em>input int</em>) – shape(qp_eval,0)</li>
<li><strong>l_evects</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>r_evects</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n5</em><em>,</em><em>qp_n6</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>eval</strong> –  rank-1 array(‘D’) with bounds (qp_n2)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_nonsymmetric_diagonalise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.insertion_sort">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">insertion_sort</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.insertion_sort" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">insertion_sort</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">insertion_sort</code><span class="sig-paren">(</span><em>this</em><span class="optional">[</span>, <em>idx</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Do an in place insertion sort on <code class="docutils literal notranslate"><span class="pre">this</span></code>, in ascending order.
If <code class="docutils literal notranslate"><span class="pre">idx</span></code> is present  then on exit it will contain the list
of indices into <code class="docutils literal notranslate"><span class="pre">this</span></code> permuted in the same way as the entries
have been.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>this</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>idx</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>size</em><em>(</em><em>qp_this</em><em>)</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">insertion_sort_i</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">insertion_sort</code><span class="sig-paren">(</span><em>this</em><span class="optional">[</span>, <em>idx</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>this</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>idx</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>size</em><em>(</em><em>qp_this</em><em>)</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">insertion_sort_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.find_in_array">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">find_in_array</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.find_in_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Search an array by element or by row.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">find_in_array</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">find_in_array</code><span class="sig-paren">(</span><em>this</em>, <em>val</em><span class="optional">[</span>, <em>mask</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>val</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>mask</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_n</strong> –  int</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">find_in_array_row</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">find_in_array</code><span class="sig-paren">(</span><em>this</em>, <em>val</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'S'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>(</em><em>*</em><em>)</em><em>)</em>) – </li>
<li><strong>val</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_n</strong> –  int</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">find_in_array_element_s</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">find_in_array</code><span class="sig-paren">(</span><em>this</em>, <em>val</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>this</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>val</strong> (<em>input int</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_n</strong> –  int</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">find_in_array_element_i</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.coordination_function">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">coordination_function</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.coordination_function" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">coordination_function</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">coordination_function</code><span class="sig-paren">(</span><em>r</em>, <em>lower_cutoff_in</em>, <em>lower_transition_width</em>, <em>upper_cutoff_in</em>, <em>upper_transition_width</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>r</strong> (<em>input float</em>) – </li>
<li><strong>lower_cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>lower_transition_width</strong> (<em>input float</em>) – </li>
<li><strong>upper_cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>upper_transition_width</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_coordination_function_lower_upper</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">coordination_function_lower_upper</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">coordination_function</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>r</strong> (<em>input float</em>) – </li>
<li><strong>cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>transition_width</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_coordination_function_upper</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">coordination_function_upper</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.make_hermitian">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">make_hermitian</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.make_hermitian" title="Permalink to this definition">¶</a></dt>
<dd><p>Test for matrix hermiticity (with floating point equals test).</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">make_hermitian</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">make_hermitian</code><span class="sig-paren">(</span><em>m</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>m</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_d_make_hermitian</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">make_hermitian</code><span class="sig-paren">(</span><em>m</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>m</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_make_hermitian</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.matrix_product_vect_asdiagonal_rl_sub">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_rl_sub</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.matrix_product_vect_asdiagonal_rl_sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_rl_sub</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_rl_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘D’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_rl_sub_zzd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">matrix_product_vect_asdiagonal_rl_sub</code><span class="sig-paren">(</span><em>matrix</em>, <em>vect</em>, <em>n0</em>, <em>n1</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>n0</strong> (<em>input int</em>) – shape(qp_lhs,0)</li>
<li><strong>n1</strong> (<em>input int</em>) – shape(qp_lhs,1)</li>
<li><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>vect</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>lhs</strong> –  rank-2 array(‘d’) with bounds (qp_n0,qp_n1)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_product_vect_asdiagonal_rl_sub_ddd</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.sort_array">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">sort_array</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.sort_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">sort_array</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">sort_array</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>r_data</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Sort an array of integers into ascending order (slow: scales as N:math:<cite>^2</cite>).
r_data is an accompanying array of reals on which the same reordering is performed</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>r_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n1</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">sort_array_i</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">sort_array</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>i_data</em>, <em>r_data</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Sort an array of integers into ascending order (slow: scales as N:math:<cite>^2</cite>).
i_data is an accompanying array of integers on which the same reordering is performed</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>i_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n1</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>r_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">sort_array_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.diagonalise">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diagonalise</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.diagonalise" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded interfaces to textsc{lapack} matrix diagonlisation
functions for real and complex matrices. Always calls
textsc{lapack}, regardless of the ‘use_intrinsic_blas’ setting.
Both diagonalisation and solution of the generalised eigenproblem
are supported, but only for real positive definite symmetric or
complex hermitian postive definite matrices.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">diagonalise</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diagonalise</code><span class="sig-paren">(</span><em>this</em>, <em>other</em>, <em>evals</em>, <em>evects</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>other</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>evals</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
<li><strong>evects</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n5</em><em>,</em><em>qp_n6</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_diagonalise_generalised</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diagonalise</code><span class="sig-paren">(</span><em>this</em>, <em>evals</em><span class="optional">[</span>, <em>evects</em>, <em>ignore_symmetry</em>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>evals</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>evects</strong> (<em>in/output rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>ignore_symmetry</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_z_diagonalise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diagonalise</code><span class="sig-paren">(</span><em>this</em>, <em>other</em>, <em>evals</em>, <em>evects</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>other</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
<li><strong>evals</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n4</em><em>)</em>) – </li>
<li><strong>evects</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n5</em><em>,</em><em>qp_n6</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_diagonalise_generalised</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">diagonalise</code><span class="sig-paren">(</span><em>this</em>, <em>evals</em><span class="optional">[</span>, <em>evects</em>, <em>ignore_symmetry</em>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>evals</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>evects</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>,</em><em>qp_n4</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>ignore_symmetry</strong> (<em>input int</em><em>, </em><em>optional</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_diagonalise</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.rms_diff">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">rms_diff</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.rms_diff" title="Permalink to this definition">¶</a></dt>
<dd><p>Root-mean-square difference calculation for components of two vectors or arrays.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">rms_diff</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">rms_diff</code><span class="sig-paren">(</span><em>array1</em>, <em>array2</em><span class="sig-paren">)</span></dt>
<dd><p>For two arrays of dimension <span class="math notranslate nohighlight">\(N \times M\)</span>, this is calculated as</p>
<div class="math notranslate nohighlight">
\[\sum_{j=1}^{M} \sum_{i=1}^{N} \left(\mathbf{a_1}_{ij} - \mathbf{a_2}_{ij}\right)^2\]</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>array1</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>array2</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_rms_diff2</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">rms_diff2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">rms_diff</code><span class="sig-paren">(</span><em>vector1</em>, <em>vector2</em><span class="sig-paren">)</span></dt>
<dd><p>For two vectors of <span class="math notranslate nohighlight">\(N\)</span> dimensions, this is calculated as</p>
<div class="math notranslate nohighlight">
\[\sum_{i=1}^{N} \left(\mathbf{v_1}_i - \mathbf{v_2}_i\right)^2\]</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>vector1</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>vector2</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n1</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_rms_diff1</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">rms_diff1</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.trace_mult">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">trace_mult</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.trace_mult" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">trace_mult</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">trace_mult</code><span class="sig-paren">(</span><em>matrixa</em>, <em>matrixb</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>matrixa</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>matrixb</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>,</em><em>qp_n3</em><em>)</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_trm</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_trace_mult</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.norm">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">norm</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the euclidean norm of a vector or of an array.
For a single vector ‘x’, ‘norm(x)’ is equal to ‘sqrt(x .dot. x)’
A two-dimensional array is treated as a list of vectors in either
Fortran (‘dir=1’) or C (‘dir=2’) style-ordering.
The result is then a one-dimensional array of the norms of each vector.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">norm</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">norm</code><span class="sig-paren">(</span><em>this</em>, <em>dir</em>, <em>n2</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>this</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>dir</strong> (<em>input int</em>) – </li>
<li><strong>n2</strong> (<em>input int</em>) – shape(qp_ret_sqvalue,0)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_sqvalue</strong> –  rank-1 array(‘d’) with bounds (qp_n2)</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">array_norm</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">norm</code><span class="sig-paren">(</span><em>vector</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vector</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_norm</strong> –  float</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">vector_norm</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.heap_sort">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">heap_sort</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.heap_sort" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">heap_sort</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">heap_sort</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>r_data</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Sort an array of integers into ascending order.
The function uses heapsort, which always scales as N log N.
r_data is an accompanying array of reals on which the same reordering is
performed
(Initial implementation by Andreas Wonisch)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>r_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n1</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">heap_sort_i</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">heap_sort</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>i_data</em>, <em>r_data</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>in/output rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>i_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>r_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">heap_sort_r_2dim</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">heap_sort</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>i_data</em>, <em>r_data</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><p>Sort an array of integers into ascending order.
The function uses heapsort, which always scales as N log N.
i_data and r_data are a accompanying arrays of integers and reals
on which the same reordering is performed
(Initial implementation by Andreas Wonisch)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>i_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n1</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>r_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">heap_sort_r</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">heap_sort</code><span class="sig-paren">(</span><em>array</em><span class="optional">[</span>, <em>i_data</em>, <em>r_data</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>array</strong> (<em>in/output rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>i_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n2</em><em>)</em><em>, </em><em>optional</em>) – </li>
<li><strong>r_data</strong> (<em>in/output rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n3</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">heap_sort_i_2dim</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.d3coordination_function">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">d3coordination_function</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.d3coordination_function" title="Permalink to this definition">¶</a></dt>
<dd><p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">d3coordination_function</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">d3coordination_function</code><span class="sig-paren">(</span><em>r</em>, <em>cutoff_in</em>, <em>transition_width</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>r</strong> (<em>input float</em>) – </li>
<li><strong>cutoff_in</strong> (<em>input float</em>) – </li>
<li><strong>transition_width</strong> (<em>input float</em>) – </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>ret_d3coordination_function_upper</strong> –  float</p>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">d3coordination_function_upper</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.is_orthogonal">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_orthogonal</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.is_orthogonal" title="Permalink to this definition">¶</a></dt>
<dd><p>Test is matrix is unitary i.e. if $M M^{-1} = I$</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">is_orthogonal</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">is_orthogonal</code><span class="sig-paren">(</span><em>matrix</em><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>matrix</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>ret_matrix_is_orthogonal</strong> –  int</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">matrix_is_orthogonal</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="quippy.linearalgebra.check_size">
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#quippy.linearalgebra.check_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded interface to assert that the size of an array is correct.
If the test fails ‘system_abort’ is called with an appropriate error message
constructed from the ‘arrayname’ and ‘caller’ arguments.</p>
<p>Routine is wrapper around Fortran interface <code class="docutils literal notranslate"><span class="pre">check_size</span></code> containing multiple routines:</p>
<blockquote>
<div><dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input int</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_complex_dim1_s</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>intarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>intarray</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n1</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_int_dim1</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>intarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>intarray</strong> (<em>input rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n2</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_int_dim2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>logarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>logarray</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input int</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_log_dim1_s</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n1</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_real_dim1</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-2 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n2</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_real_dim2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-3 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>,</em><em>qp_n2</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n3</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_real_dim3</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>intarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>intarray</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input int</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_int_dim1_s</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-1 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n1</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_complex_dim1</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-2 array</em><em>(</em><em>'D'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n2</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_complex_dim2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>realarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>realarray</strong> (<em>input rank-1 array</em><em>(</em><em>'d'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input int</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_real_dim1_s</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>logarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>logarray</strong> (<em>input rank-2 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>,</em><em>qp_n1</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n2</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_log_dim2</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

<dl class="function">
<dt>
<code class="descclassname">quippy.linearalgebra.</code><code class="descname">check_size</code><span class="sig-paren">(</span><em>arrayname</em>, <em>logarray</em>, <em>n</em>, <em>caller</em><span class="optional">[</span>, <em>error</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>arrayname</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>logarray</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>qp_n0</em><em>)</em>) – </li>
<li><strong>n</strong> (<em>input rank-1 array</em><em>(</em><em>'i'</em><em>) </em><em>with bounds</em><em> (</em><em>n1</em><em>)</em>) – </li>
<li><strong>caller</strong> (<em>input string</em><em>(</em><em>len=-1</em><em>)</em>) – </li>
<li><strong>error</strong> (<em>in/output rank-0 array</em><em>(</em><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a><em>,</em><em>'i'</em><em>)</em><em>, </em><em>optional</em>) – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Routine is wrapper around Fortran routine <code class="docutils literal notranslate"><span class="pre">check_size_log_dim1</span></code> defined in file <a class="reference external" href="https://github.com/libAtoms/QUIP/blob/public/src/libAtoms/linearalgebra.f95">src/libAtoms/linearalgebra.f95</a>.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="quaternions.html" class="btn btn-neutral float-right" title="Quaternions and rotation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2008-2016, James Kermode

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>